package config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016102300747183";	//2088722346553236|2021001144673328

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCVME3WgwAFNQ1yMgLjC3ajWYDNe7WrpO35I8/VBOXOJ+bxu0P6EOVqpFDxzNUEpHDIMScV5WlyVuRlEQ+hvDZxRPJob0PMzcfL15BmDRDOSmmWUM1YsVXWB7n8AUdB/koVgx3ZWLAvNdx1sl+b+UlZKHtGNn6YNW6a8UJpmyEAJuyx7CmSe04R8ZstzGvar4g76MGGHAp3KnWli93ETFbG0o51ZY+cNGPtvcIoRO5Fgpl1UeUeLGF8W+NshdQB9nyuTASs/rBDNMjHjBS0MRDFrliajb/bXNqaiNnCMs6CsoUGE5/Kl8bnRtiJ6tmPNRnUBeezcG0BCeoQorejxUaJAgMBAAECggEARTPi515c5A1370DDlg37OkqKNMbtvnEC8k5qWaWr87UOq5LyNU0hHhaadY9OQJkGt9YVC1MfVqp3x2nilmN33ZLd3xO9n4LU6vlTQgNNiGN8Fv3kQv//kQiEfSEarMIIG3J2phs9nqidWvsi3ncETxc4F5mvn2spozXGWLZc2HSAa8CqqLR/+o29O79jEqgeEPN+0Wmm8kxBw90ZRWhz5mvI2mDw28rnK8k1OobF8IlEZH4DTWC9Moo810VkH9+FKhAROAL6/WvaX6UplRxRe2WnuZLNxO3n52djx1WAvnl//SC+55yeKjQotiSAwI2TYyLHWCdDZz+/HhGpSHnbAQKBgQDKdfkCqRkTx4yC5yBmRQRqr1g8YKm8h4ms0DxiKPlpGGC6MDcb9IKXKfSd0Ezvnv+ARpwoRUx3DQLAwBUbtXZZ+GuCEV3Kp7hMHmCSiqe/SVnNSf9wQBmMaoOVU409rvCkAUr6jy+yp4H+hstExi43agv32RT83bTr6BQQydM/kwKBgQC8o/UeeqMZBMFS8QH+bScztEx63Wz6s+mklohdrI5E3ZruFnrjPqKvM3q3cd8zAGNkyegQScAHYDHupwgz8WNCbXqwWbTyiemxYX5tuwCjvrIGeHvsx342S2DLUIWzJs2/rtDDV70vI5bhvXzlULiRs1sg8Jm5UAnBi5UOpeka8wKBgBSlQRZHXhpJQAfdP82N/ixO4yWNCeICxEROG8o6uWxBIyP5ZLVCEssNaTdqlV3eDdnr2WK15l1Bg2VacQyZTY9RKM1jrffLcJy6gEiRQRfdh/3KLPUqZDCQcAibM4z1uO5Qf2/biBakxDnLTxEdUHswIjZM+bnrddaUnO81VYhnAoGADL7XNPP8SRh1J3F5PQOK/odUE4kab+XwB1rUY9/gzO5cJXIHY4s72rKTvAlJl1yTWp/5ugABpX3uYb2PZFMO7dIP1BJ7k1eWHpIDxM45wNaFmMJTPTBNasW1CIesQOqCRE0/dbNb6O9yplXzNls53T5NDfCzsj2iKx2POKolEdkCgYBlYiHKcM+M5GvNXzTkHmiHC/+iZ0u9UuMzSWzX18RB12WJoweT3kLeAnkm0cyJNF5vqKUB401zAI5eY57hEa6m9Y4yVvCqsevsaRU1BI7jhnj2DO5BXiyAS7HS2t0AkzthF8Y+o8iLCXTBMJfnQzqjV3uvwniTaC/jHxAjzTkPLg==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3SY0VLoQM3TiDKAV1bQQ7T5pAZcrFyQoR6YytbjPGGpTTKpGtk9xxsQgUjP40pL6VlH0DRvBa6qfj2pEn7c/EOPVz7dQKXxi9zJQJnnUTVNI2oihqaK8bXucJjaxbgY7nyvvSS1jugZlQ3vyzKvtaSLtbr/Frl4DI+GuJugc127MucrdxKQS7O99CMoemvZETtVKE/nhqI/4RGtqrdjpmwTJobz5LnCQvB6lLnVVWt+Sh1v01JorAB7LC9y608Z5qf65EwsYZSmsoJGeV688JCEl9wedrUbwbp1GvIGlvL7ZUuDn0ztIpEKy8QHGkSJDcFyNR/rlz47d29rV1s348wIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://gqduk5.natappfree.cc/zhiFuBao/aliPayNotifyUrlServlet";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://gqduk5.natappfree.cc/zhiFuBao/aliPayReturnUrlServlet";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
